<?php
/**
 * Created by PhpStorm.
 * User: ADMIN
 * Date: 2021/5/18
 * Time: 17:48
 */
namespace app\adminapi\controller;

use app\common\controller\AdminApi;
use think\captcha\Captcha;

/**
 * Class Index
 * @package app\adminapi\controller
 */
class Index extends AdminApi
{
    protected $noNeedLogin = '';
    protected $noNeedRight = ['*'];

    /**
     * 全局miss路由
     */
    public function miss()
    {
        $this->error('非法访问', null, '404');
    }

    public function captcha()
    {
        $captcha = new Captcha();
        // 设置验证码字符为纯数字
        $captcha->codeSet = '0123456789';
        $captcha->length = 4;
        return $captcha->entry();
    }
}